Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
How do I disable the "Leave page" confirmation dialog in Firefox?

I have the following code in my Vue application for detecting when the user closes the tab:

onBeforeUnload() {
  window.onbeforeunload = null;
  return undefined;
}

Disabling the "Leave page" confirmation dialog works in Chrome, but not on Firefox. Why is that? How do I disable the confirmation dialog on Firefox?

Edit 1: Adding and removing beforeunload listeners

created() {
    window.addEventListener('beforeunload', this.onBeforeUnload);
},
beforeDestroy() {
    window.removeEventListener('beforeunload', this.onBeforeUnload);
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Changing my onBeforeUnload method to this fixed the problem:

onBeforeUnload(e) {
  window.onbeforeunload = () => {};
  delete e.returnValue;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda